package com.chengfei.house.web.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author chengfei cheng.fei@chinaott.onaliyun.com
 **/
public class WebMvcConf extends WebMvcConfigurerAdapter{
    @Autowired
    private AuthActionInterceptor authActionInterceptor;
    @Autowired
    private AuthInterceptor authInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authInterceptor)
                .excludePathPatterns("/static")
                .addPathPatterns("/**");
        registry.addInterceptor(authActionInterceptor)
                .addPathPatterns("/accounts/profile");
        super.addInterceptors(registry);
    }
}
